cmake_minimum_required(VERSION 3.10)
project(PicProc)
set(CMAKE_CXX_STANDARD 17)


if (WIN32)
	if (MSVC)
		if (CMAKE_CL_64)
			set(ONNXRUNTIME_ROOT third_part\\onnxruntime-win-x64-1.4.0)
			set(ARTICHITECTURE x64)
		else()
			set(ONNXRUNTIME_ROOT third_part\\onnxruntime-win-x86-1.4.0)
			set(ARTICHITECTURE x86)
		endif()
		set(ONNXRUNTIME_INCLUDE_DIR ${ONNXRUNTIME_ROOT}\\include)
		set(ONNXRUNTIME_LIBRARY_DIR ${ONNXRUNTIME_ROOT}\\lib)
	endif()
	add_definitions(-D__WIN32)
	set(PLATFORM "Windows ${ARTICHITECTURE}")
elseif (UNIX)
	set(ONNXRUNTIME_ROOT third_part/onnxruntime-linux-x64-1.4.0)
	set(ONNXRUNTIME_INCLUDE_DIR ${ONNXRUNTIME_ROOT}/include)
	set(ONNXRUNTIME_LIBRARY_DIR ${ONNXRUNTIME_ROOT}/lib)
	set(PLATFORM LINUX)
endif()

message(STATUS ${PLATFORM})

set(ONNXRUNTIME_LIBS onnxruntime)


include_directories(
	include
	${ONNXRUNTIME_INCLUDE_DIR}
)

link_directories(
	${ONNXRUNTIME_LIBRARY_DIR}
)

set(
	WZZ_LIBRARY_SRC
	src/wzz/picproc_api.cpp include/wzz/picproc_api.h
	src/wzz/picproc_internal.hpp
)

add_library(wzz SHARED ${WZZ_LIBRARY_SRC})
target_link_libraries(wzz ${ONNXRUNTIME_LIBS})

add_executable(test-onnx test/test-onnx.cpp)
target_link_libraries(test-onnx ${ONNXRUNTIME_LIBS})

